package cn.iocoder.yudao.module.crossborder.order.dal.mysql.ordershipmentitem;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.crossborder.order.dal.dataobject.ordershipmentitem.OrderShipmentItemDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.crossborder.order.controller.admin.ordershipmentitem.vo.*;

/**
 * 跨境电商发货明细 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface OrderShipmentItemMapper extends BaseMapperX<OrderShipmentItemDO> {

    default PageResult<OrderShipmentItemDO> selectPage(OrderShipmentItemPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<OrderShipmentItemDO>()
                .eqIfPresent(OrderShipmentItemDO::getShipmentId, reqVO.getShipmentId())
                .eqIfPresent(OrderShipmentItemDO::getShipmentNo, reqVO.getShipmentNo())
                .eqIfPresent(OrderShipmentItemDO::getOrderItemId, reqVO.getOrderItemId())
                .eqIfPresent(OrderShipmentItemDO::getSkuId, reqVO.getSkuId())
                .eqIfPresent(OrderShipmentItemDO::getSkuCode, reqVO.getSkuCode())
                .likeIfPresent(OrderShipmentItemDO::getProductName, reqVO.getProductName())
                .eqIfPresent(OrderShipmentItemDO::getQuantity, reqVO.getQuantity())
                .eqIfPresent(OrderShipmentItemDO::getWeight, reqVO.getWeight())
                .eqIfPresent(OrderShipmentItemDO::getVolume, reqVO.getVolume())
                .eqIfPresent(OrderShipmentItemDO::getBatchNo, reqVO.getBatchNo())
                .eqIfPresent(OrderShipmentItemDO::getSerialNos, reqVO.getSerialNos())
                .eqIfPresent(OrderShipmentItemDO::getLocationCode, reqVO.getLocationCode())
                .eqIfPresent(OrderShipmentItemDO::getPackageNo, reqVO.getPackageNo())
                .betweenIfPresent(OrderShipmentItemDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(OrderShipmentItemDO::getId));
    }

}